import request from '@/utils/request'
export function handleList(data) {
  return request({
    url: '/product',
    method: 'post',
    data
  })
}

export function handleEdit(queryData) {
  return request({
    url: '/product/handleEdit',
    method: 'post',
    data: queryData
  })
}

export function handleAdd(queryData) {
  return request({
    url: '/product/handleAdd',
    method: 'post',
    data: queryData
  })
}

export function handleDel(queryData) {
  return request({
    url: '/product/handleDel',
    method: 'post',
    data: queryData
  })
}

export function changeStatus(queryData) {
  return request({
    url: '/product/handleStatus',
    method: 'post',
    data: queryData
  })
}

/**
 * 获取单位列表
 */
export function getUnitList() {
  return request({
    url: '/category.index',
    method: 'post',
    data: {
      page: 1,
      limit: 1000,
      model: 89,
      pid: 89,
      keyword: ''
    }
  })
}

/**
 * 批量修改品牌
 * @param {{
 *  product_id: number[]
 *  brand_id: string
 * }} data
 * @returns
 */
export function batchBrand(data) {
  return request({
    url: '/product/batchBrand',
    method: 'post',
    data
  })
}
